package com.sright.bcard.user.dal.mapper;

import com.sright.bcard.common.service.share.base.dao.BaseMapper;
import com.sright.bcard.user.dal.entity.VisitorListDO;
import com.sright.bcard.user.dal.entity.ext.VisitorRelationEXTDO;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface VisitorListMapper extends BaseMapper<VisitorListDO> {
    int deleteByPrimaryKey(Long id);

    List<VisitorListDO> selectByEnterpriseIdAndSourceIdNotZero(@Param("enterpriseId") Long enterpriseId);

    List<VisitorListDO> selectByEnterpriseId(@Param("enterpriseId") Long enterpriseId);

    List<VisitorListDO> selectByEnterpriseIdBwtDate(@Param("enterpriseId") Long enterpriseId, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);

    List<VisitorListDO> selectByEnterpriseIdAndMemberIdBeforeDate(@Param("enterpriseId") Long enterpriseId, @Param("visitorMemberId") Long visitorMemberId, @Param("beginDate") Date beginDate);

    List<VisitorListDO> selectByVisitorId(Long visitorId);

    Integer selectSumTimeByVisitorId(Long visitorId);

    List<VisitorListDO> selectAllByVisitorId(Long visitorId);

    List<VisitorRelationEXTDO> selectByMemberId(@Param("visitorMemberId") Long visitorMemberId);

    List<VisitorRelationEXTDO> selectByUserId(@Param("visitorUserIdList") List<Long> visitorUserIdList);

    List<VisitorListDO> selectByUserIdAndData(@Param("userId") Long userId, @Param("beginDate") Date beginTime, @Param("endDate") Date endTime, @Param("memberId") Long memberId);
}